﻿using System;
using System.Collections.Generic;
using System.Text;

namespace StockTrader.BusinessService.DataContract.Mortgate
{
    public class StocksData
    {
        public string Symbol { get; set; }
        public decimal Quantity { get; set; }
        public decimal Ref { get; set; }
        public int TillSettlement { get; set; }
        public decimal AllowRate { get; set; }
        public string Name { get; set; }
        public decimal Value
        {
            get { return Quantity * Ref * 1000; }
        }


        public StocksData() { }
        public StocksData(string symbol, decimal quantity, decimal refprice, string name)
        {
            Symbol = symbol;
            Ref = refprice;
            Quantity = quantity;
            Name = name;

        }
        public StocksData(string symbol, decimal quantity, decimal refprice, decimal allowrate, string name)
        {
            Symbol = symbol;
            Ref = refprice;
            Quantity = quantity;
            Name = name;
            AllowRate = allowrate;
        }
        public StocksData(string symbol, decimal quantity, decimal refprice, int tillsettlement, decimal allowrate, string name)
        {
            Symbol = symbol;
            Ref = refprice;
            Quantity = quantity;
            Name = name;
            AllowRate = allowrate;
            TillSettlement = tillsettlement;
        }

        public bool IsEquals(StocksData item)
        {
            if ((item.Symbol.Equals(Symbol)) && (item.TillSettlement.Equals(TillSettlement)))
                return true;
            else
                return false;
        }

    }
}
